package com.yuhang.demo.enums;

import lombok.Getter;

@Getter
public enum RuleTypeEnum {
    DRUG_GENDER("DRUG_GENDER", "药品区分性别使用"),
    MEDICAL_CHILD("MEDICAL_CHILD", "医疗服务项目儿童专用");

    private final String code;
    private final String desc;

    RuleTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    // 根据code获取枚举
    public static RuleTypeEnum getByCode(String code) {
        for (RuleTypeEnum type : values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        return null;
    }
}
